package cfi.jdo;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

@PersistenceCapable(detachable = "true")
public class Ticket {
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;

	// チケット開始日
	@Persistent
	private Date startDate;

	// チケット終了日
	@Persistent
	private Date startEnd;

	// 使用可能数(全)
	@Persistent
	private int valCountAll;

	// 使用可能数(残り)
	@Persistent
	private int valCountLeft;

	// 購入者
	@Persistent
	private CoffeeCustomer coffeeCustomer;

	public Ticket(Date startDate, int valCountAll, int valCountLeft,
			CoffeeCustomer customer) {
		super();
		this.startDate = startDate;
		this.valCountAll = valCountAll;
		this.valCountLeft = valCountLeft;
		this.coffeeCustomer = customer;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getStartEnd() {
		return startEnd;
	}

	public void setStartEnd(Date startEnd) {
		this.startEnd = startEnd;
	}

	public int getValCountAll() {
		return valCountAll;
	}

	public void setValCountAll(int valCountAll) {
		this.valCountAll = valCountAll;
	}

	public int getValCountLeft() {
		return valCountLeft;
	}

	public void setValCountLeft(int valCountLeft) {
		this.valCountLeft = valCountLeft;
	}

	public CoffeeCustomer getCustomer() {
		return coffeeCustomer;
	}

	public void setCustomer(CoffeeCustomer customer) {
		this.coffeeCustomer = customer;
	}

	public Key getKey() {
		return key;
	}

	public void setKey(Key key) {
		this.key = key;
	}

}
